<?php

class GDGE_Auth_Config
{
	
	const ID_FIELD = 'idField';
	const USERNAME_FIELD = 'userField';
	const PASSWORD_FIELD = 'passwordField';
	const BANNED_FIELD = 'bannedField';
	
	/**
	 * 
	 * Default configuration for authentication
	 * @var array
	 */
	private $_config = array(
		self::ID_FIELD => 'id',
		self::USERNAME_FIELD => 'username',
		self::PASSWORD_FIELD => 'password',
		self::BANNED_FIELD => 'is_banned'
	);
	
	/**
	 * 
	 * Database table for users
	 * @var Zend_Db_Table_Abstract
	 */
	private $_table;
	
	public function __construct(Zend_Db_Table_Abstract $table, $config = array())
	{
		$this->_table = $table;
		if (is_array($config)) {
			$this->_config = array_merge($this->_config, $config);
		}
	}
	
	public function getTable() {
		return $this->_table;
	}
	
	public function getIdField() {
		return $this->_config[self::ID_FIELD];
	}

	public function getUsernameField() {
		return $this->_config[self::USERNAME_FIELD];
	}
	
	public function getPasswordField() {
		return $this->_config[self::PASSWORD_FIELD];
	}
	
	public function getBannedField() {
		return $this->_config[self::BANNED_FIELD];
	}
	
	public function getConfig() {
		return $this->_config;
	}
}